function I = TrapezoidalIntegration(fx, a, b, n)
f = inline(fx);
h = (b - a) / n;
I = f(a) + f(b) / 2;
x = a + h;
while (x < b)
    I = I + f(x);
    x = x + h;
end;
I = h * I;
end

